const UserService = require('../service/user')

// 接收模型查询结果，并且返回
class UserController {
  async login(ctx) {
    let data = await UserService.login(ctx);
    ctx.body = data;
  }

  async register(ctx) {
    let data = await UserService.register(ctx)
    ctx.body = data;
  }

  async findAll(ctx) {
    let data = await UserService.findAll(ctx)
    ctx.body = data
  }

  async add(ctx) {
    let data = await UserService.add(ctx)
    ctx.body = data;
  }

  async update(ctx) {
    let data = await UserService.update(ctx)
    ctx.body = data;
  }

  async delete(ctx) {
    let data = await UserService.delete(ctx)
    ctx.body = data;
  }

  async page(ctx) {
    let data = await UserService.page(ctx);
    ctx.body = data;
  }

  async search(ctx) {
    let data = await UserService.search(ctx);
    ctx.body = data;
  }
}


module.exports = new UserController